<template lang="pug">
  ModuleWrapper(title="乡村劳动力（人）" flex="1")
    .chart-wrap(ref="chart")
</template>

<script>
export default {
  name: "ModulePopulation",
  data() {
    return {
      chart: null,
      data: [
        {
          label: '总人口',
          value: 0,
        },
      ]
    }
  },
  methods: {
    renderChart() {
      this.chart = this.$echarts.init(this.$refs['chart']);
      this.chart.setOption({
        xAxis: {
          type: 'category',
          data: ['2015', '2016', '2017', '2018', '2019'],
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          top: '15%',
          containLabel: true
        },
        yAxis: {
          type: 'value',
          scale: true,
          // min: 8000,
          // max: 10000,
          // interval: 400,
          splitLine: false
        },
        series: [
          {
            data: [88396, 87655, 86509, 87442, 86794],
            type: 'line',
            smooth: true,

            lineStyle: {
              color: "#f79f56",

            },
			label:{
				show:true,
				position:"top",
				textStyle:{
					color:"#fff"
				}
			},
            itemStyle: {
              color: "#f79f56",
            }
          }
        ]
      });
    },
  },
  mounted() {
    this.$nextTick(() => {
      this.renderChart();
    });
  }
}
</script>

<style lang="scss" scoped>
.module{
  display: flex;
  flex-direction: column;
  .chart-wrap{
    flex: 1;
  }
}
</style>
